{extend name="adminheader:header"/}
{block name="content"}
    <body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>修改会员信息</h5>
                    </div>
                    <div class="ibox-content">
                        <form action="{:url('/admin/User/editPost')}" method="post" class="form-horizontal js-ajax-form m-t">
                            <input type="hidden" name="id" value="{$list.id}" />
                            <div class="form-group">
                                <label class="col-sm-3 control-label">推荐id<span class="form-required">*</span></label>
                                <div class="col-md-6 col-sm-10">
                                    <input name="recom_id" type="text" class="form-control" value="{$list.recom_id}" placeholder="请输入推荐id" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">会员类型<span class="form-required">*</span></label>
                                <div class="col-md-6 col-sm-10">
                                     <select class="form-control" name="u_type">
                                        <option value="">请选择类型</option>
                                        <option value="1" {if condition="$list.u_type eq 1"}selected{/if}>普通会员</option>
                                        <option value="2" {if condition="$list.u_type eq 2"}selected{/if}>专柜会员</option>
                                        <option value="3" {if condition="$list.u_type eq 3"}selected{/if}>合伙人</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">会员姓名<span class="form-required">*</span></label>
                                <div class="col-md-6 col-sm-10">
                                    <input name="u_name" type="text" class="form-control" value="{$list.u_name}" placeholder="请输入会员姓名" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">会员身份证号<span class="form-required">*</span></label>
                                <div class="col-md-6 col-sm-10">
                                    <input name="u_card" type="text" class="form-control" value="{$list.u_card}" placeholder="请输入会员身份证号" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">性别<span class="form-required">*</span></label>
                                <div class="col-md-6 col-sm-10">
                                   <input type="radio" name="u_sex" id="inlineRadio1" value="1" {$list.u_sex == 1 ? 'checked':''} style="cursor: pointer;margin-right:5px"/>女&nbsp;&nbsp;&nbsp;&nbsp;
                                   <input type="radio" name="u_sex" id="inlineRadio2" value="2" {$list.u_sex == 2 ? 'checked':''} style="cursor: pointer;margin-right:5px"/>男&nbsp;&nbsp;&nbsp;&nbsp;
                                   <input type="radio" name="u_sex" id="inlineRadio3" value="3" {$list.u_sex == 3 ? 'checked':''} style="cursor: pointer;margin-right:5px"/>保密
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">手机号码<span class="form-required">*</span></label>
                                <div class="col-md-6 col-sm-10">
                                    <input name="u_tel" type="text" class="form-control" value="{$list.u_tel}" placeholder="请输入手机号码" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">店铺名称<span class="form-required">*</span></label>
                                <div class="col-md-6 col-sm-10">
                                    <input name="u_store" type="text" class="form-control" value="{$list.u_store}" placeholder="请输入店铺名称" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">店铺地址<span class="form-required">*</span></label>
                                <div class="col-md-6 col-sm-10">
                                    <textarea class="form-control" name="u_address" placeholder="请填写店铺地址">{$list.u_address}</textarea>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">照片<span class="form-required">*</span></label>
                                <div class="col-md-6 col-sm-10">
                                    <input type="hidden" name="u_license" id="thumbnail" value="{$list.u_license|default=''}">
                                    <a href="javascript:uploadOneImage('图片上传','#thumbnail');">
                                        {if condition="empty($list.u_license)"}
                                            <img src="/static/img/default-thumbnail.png" id="thumbnail-preview" width="100" height="100" style="cursor: pointer"/>
                                        {else/}
                                            <img src="{:getPreviewUrl($list.u_license)}" id="thumbnail-preview" width="100" height="100" style="cursor: pointer"/>
                                        {/if}
                                    </a>
                                    <input type="button" class="btn btn-sm btn-cancel-thumbnail" value="取消图片">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">注册时间<span class="form-required">*</span></label>
                                <div class="col-md-6 col-sm-10">
                                    <input class="form-control js-bootstrap-datetime" type="text" name="registr_time" value="{:date('Y-m-d H:i',$list['registr_time'])}">
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-4 col-sm-offset-3">
                                    <button class="btn btn-primary js-ajax-submit" type="submit">保存</button>
                                    <a class="btn btn-default" href="{:url('/admin/User/index')}">返回</a>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
<script src="/admin/js/admin.js"></script>
<script type="text/javascript">
    $(function () {

        $('.btn-cancel-thumbnail').click(function () {
            $('#thumbnail-preview').attr('src', '/static/img/default-thumbnail.png');
            $('#thumbnail').val('');
        });

    });
</script>
{/block}